<?php

    require_once($application_folder."/controllers/navigator.php");
    class transaction extends navigator {

        function transaction() {
            parent::navigator();

            $this->load->library('form_validation');
            $this->title("Globtour - Transaction");

            $this->load->model('users_m','usersm');              
            $this->load->model('transaction_m','transm');
            
            $this->usersm->check_log(1); 
            $this->data['language'] = $this->lang_ses->getLang();
        }

        function view() {
            $this->usersm->check_log(1); // check admin login
            
            $this->carabiner->css('tablesorter/style.css');   
            $this->carabiner->js('tablesorter/jquery.tablesorter.js');   

            $this->data['transaction'] = $this->transm->readTransaction();
            $this->navigate('transaction/transaction_v');

        }

        function confirm_reverse($id){
            $this->usersm->check_log(1); // check admin login

            $this->title("Globtour - Transkacija :: REVERSE");
            $this->carabiner->js('transaction/reverse.js');

            $this->data['confirm_reverse'] = $this->transm->confirm_reverse($id);
            $this->navigate('transaction/confirm_reverse_v');
        }

        function reverse_transaction_dms(){
            $this->usersm->check_log(1);
            $this->transm->reverse_transaction_dms(); 
        }

        function confirm_dms($id){
            $this->usersm->check_log(1); // check admin login
            
            $this->title("Globtour - Transkacija :: DMS");
            $this->carabiner->js('transaction/dms.js');

            $this->data['confirm_dms'] = $this->transm->confirm_dms($id);
            $this->navigate('transaction/confirm_dms_v');
        }

        function transaction_dms(){
            $this->usersm->check_log(1);
            $this->transm->make_transaction_dms(); 
        }

        function confirm_close_bd(){
            $this->usersm->check_log(1); // check admin login
            
            $this->title("Globtour - Transkacija :: CLOSE BUSINESS DAY");
            $this->carabiner->js('transaction/close_bd.js');

            $this->navigate('transaction/confirm_close_bd_v');
        }

        function close_bd(){
            $this->usersm->check_log(1);
            $this->transm->close_bd();
        }

    }

?>